﻿
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="TodoList3.index" %>

<%@ Import Namespace="System.Data.OleDb" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>

<!--
<script>
    sub Page_Load
    dim dbconn, sql, dbcomm, dbread
    dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & server.mappath("/db/northwind.mdb"))
    dbconn.Open()
    sql = "SELECT * FROM Item"
    dbcomm = New OleDbCommand(sql, dbconn)
    dbread = dbcomm.ExecuteReader()
    TodoItem.DataSource = dbread
    TodoItem.DataBind()
    dbread.Close()
    dbconn.Close()
    end sub
</script>
-->
<body>
    <form id="form1" runat="server">
        <div>
            <asp:TextBox ID="Title" runat="server"></asp:TextBox>
            <br />
            <br />
            <asp:Button ID="submit" runat="server" Text="Add" OnClick="Submit" />
        </div>
        <br />
        <asp:DataList ID="Table"  runat="server" DataKeyField="id" DataSourceID="TodoItem">
            <HeaderTemplate>TodoList:</HeaderTemplate>
            <ItemTemplate>
                <br />
                <asp:Label ID="titleLabel" runat="server" Text='<%# Eval("title") %>' />
                <br />

            </ItemTemplate>
        </asp:DataList>
        <asp:SqlDataSource ID="TodoItem" runat="server" ConnectionString="<%$ ConnectionStrings:AddItem %>" SelectCommand="SELECT * FROM [Item]"></asp:SqlDataSource>
    </form>
</body>
</html>
